﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel;
using System.ServiceModel.Web;
using ApiPrototype.Handlers;
using ApiPrototype.Models;
using System.Collections.Specialized;
using System.Net.Http;

namespace ApiPrototype.APIs
{
    [ServiceContract]
    public class AfwezighedenApi
    {
        [WebInvoke(Method = "POST"), ContentParam(ParamName = "docenten", ParamType = typeof(int[]))]
        public ApiResponse<List<AFWEZIGHEID>> Post(int[] docenten, iphlEntities ctx, HttpRequestMessage request)
        {
            DateTime now = DateTime.Now.Date;
            var result = ctx.AFWEZIGHEID.Where(a => a.AFW_DATUM >= now && docenten.Contains(a.DOC_ID)).ToList();
            return new ApiResponse<List<AFWEZIGHEID>>(result);
        }

    }
}